/*
 *  $Id: RagimaTheDarkness.cs 1055 2010-05-19 12:02:44Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Darkness.Creatures {
    public class RagimaTheDarkness: RagimaCreatureCard {
        public RagimaTheDarkness() : base("001_d_c_r_the_darkness", ElementType.Darkness) {
            Level = CompleteLevel.ReadyForTest;
            Value = 100;
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add<Affects.FlightBlock>();
            affects.Add<Affects.MassBlock>();
            affects.Add<Affects.Cannibal>();
            affects.Add(new Affects.FearAura(4));
            affects.Add<Affects.Vampire>();
            affects.Add(new Affects.OnCreatureSummon(DoSummon, AffectSummaryType.Local));
        }

        private static void DoSummon(Creature ragima) {
            SetDeath(ragima, ragima.Owner);
            SetDeath(ragima, ragima.Owner.Enemy);
        }
        private static void SetDeath(Creature ragima, Player owner) {
            foreach (Creature cr in owner.GetCreatures())
                if (cr != ragima)
                    cr.AddAffect(new Affects.Death(1));
        }
    }
}
